package assets

import (
	"embed"
	"github.com/tjfoc/gmsm/sm2"
	"github.com/tjfoc/gmsm/x509"
)

//go:embed UserV4.esl sign_cert.pem sign_key.pem
var fs embed.FS

// Seal 获取印章DER编码
func Seal() []byte {
	raw, _ := fs.ReadFile("UserV4.esl")
	return raw
}

// SigCert 获取签名证书
func SigCert() *x509.Certificate {
	raw, _ := fs.ReadFile("sign_cert.pem")
	cert, _ := x509.ReadCertificateFromPem(raw)
	return cert
}

// SigKeyPair 获取签名密钥对
func SigKeyPair() *sm2.PrivateKey {
	raw, _ := fs.ReadFile("sign_key.pem")
	kp, _ := x509.ReadPrivateKeyFromPem(raw, nil)
	return kp
}
